package com.lsk.servicemap.service;

import com.lsk.internalcommon.DTO.ResponseResult;
import com.lsk.internalcommon.response.DirectionResponse;
import com.lsk.servicemap.remote.MapDirectionClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DirectionService {
    @Autowired
    private MapDirectionClient mapDirectionClient;

    /**
     * 根据起点和终点的经纬度获取距离和时长
     * @param deplongitude
     * @param deplatitude
     * @param destlongitude
     * @param destlatitude
     * @return9
     */
    public ResponseResult driving(String deplongitude,String deplatitude,String destlongitude,String destlatitude){
        DirectionResponse direction = mapDirectionClient.direction(deplongitude, deplatitude, destlongitude, destlatitude);

        return ResponseResult.success(direction);
    }
}
